home *** CD-ROM | disk | FTP | other *** search
/ Total Network Tools 2002 / NextStepPublishing-TotalNetworkTools2002-Win95.iso / Archive / Misc Servers / Zope.exe / PROPERTYTYPE.DTML < prev    next >
Encoding:
Text File  |  2000-05-25  |  4.5 KB  |  142 lines

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
  2. <html lang="en">
  3. <head>
  4. <title>Change Property Types</title>
  5. </head>
  6. <body bgcolor="#FFFFFF" link="#000099" vlink="#555555">
  7. <dtml-var manage_tabs>
  8.  
  9. <dtml-if Principia-Version>
  10. <p>
  11. <em>You are currently working in version <dtml-var Principia-Version></em>
  12. </p>
  13. </dtml-if Principia-Version>
  14.  
  15. <dtml-unless props>
  16.   <dtml-if ids>
  17.     <dtml-call expr="REQUEST.set('props', [])">
  18.     <dtml-call expr="REQUEST.set('old_ids', ids)">
  19.     <dtml-in propertyMap mapping>
  20.       <dtml-if expr="id in ids">
  21.         <dtml-call expr="props.append({'new_id': propertyLabel(id),
  22.           'new_type': type, 'new_value': getProperty(id),
  23.           'was_seq': type in ('tokens', 'lines', 'multiple selection')})">
  24.       </dtml-if>
  25.     </dtml-in>
  26.   </dtml-if>
  27. </dtml-unless>
  28.  
  29. <form action="<dtml-var URL1>" method="POST">
  30. <dtml-if old_ids>
  31. <p>
  32. To change property names and values, edit them and click
  33. "Save Changes". To edit properties using their new type,
  34. select the new types and click "Edit with new Types"
  35. </p>
  36. <table border="0" cellspacing="0" cellpadding="2">
  37. <tr>
  38.   <td><b>Property Name</b></td>
  39.   <td><b>Value</b></td>
  40.   <td><b>New Type</b></td>
  41. </tr>
  42.  
  43. <dtml-in old_ids>
  44. <input type="hidden" name="old_ids:list" value="&dtml-sequence-item;">
  45. </dtml-in>
  46.  
  47. <dtml-in props mapping>
  48.  
  49. <dtml-if expr="new_type in ('tokens', 'lines', 'multiple selection')">
  50. <input type="hidden" name="props.was_seq:records" value="1">
  51. <dtml-else>
  52. <input type="hidden" name="props.was_seq:records" value="">
  53. </dtml-if>
  54.  
  55. <dtml-let value_name="'props.new_value:' + {'multiple selection': 'list',
  56.    'selection': 'string'}.get(new_type, new_type) + ':records'">
  57. <tr>
  58.   <td align="left" valign="top">
  59.     <input type="text" name="props.new_id:records" value="&dtml-new_id;">
  60.   </td>
  61.   <td align="left" valign="top">
  62.   <dtml-if expr="new_type in ('int', 'long', 'float', 'date', 'string', 'tokens')">
  63.   <input type="text" name="&dtml-value_name;" size="35"
  64.     <dtml-if was_seq>
  65.     value="<dtml-in new_value>&dtml-sequence-item; </dtml-in>"
  66.     <dtml-elif expr="new_type=='long'">
  67.     value="<dtml-var expr="_.str(getProperty(id))[:-1]" html_quote>"
  68.     <dtml-else>
  69.     value="&dtml-new_value;"
  70.     </dtml-if>>
  71.   <dtml-elif "new_type=='boolean'">
  72.   <input type="checkbox" name="&dtml-value_name;" size="35"
  73.    <dtml-if new_value>CHECKED</dtml-if>>
  74.   <dtml-elif "new_type in ('text', 'lines')">
  75.   <textarea name="&dtml-value_name;" rows="6" cols="35"><dtml-if was_seq><dtml-in
  76.   new_value>&dtml-sequence-item;<dtml-unless
  77.    sequence-end><dtml-var expr="'\n'"></dtml-unless></dtml-in><dtml-else>&dtml-new_value;</dtml-if></textarea>
  78.   <dtml-elif "new_type=='selection'">
  79.     <dtml-if "_.has_key(select_variable)">
  80.     <select name="&dtml-value_name;">
  81.       <dtml-in "_[select_variable]">
  82.          <option
  83.           <dtml-if "_['sequence-item']==new_value">SELECTED</dtml-if>
  84.           >&dtml-sequence-item;</option>
  85.       </dtml-in>
  86.     </select>
  87.     <dtml-else>
  88.        No value for <dtml-var select_variable>.
  89.     </dtml-if>
  90.   <dtml-elif "new_type=='multiple selection'">
  91.     <dtml-if "_.has_key(select_variable)">
  92.     <select name="&dtml-value_name;" multiple
  93.       size="<dtml-var "_.min(7, _.len(_[select_variable]))">">
  94.       <dtml-in "_[select_variable]">
  95.          <option<dtml-if
  96.          "_['sequence-item'] in new_value"> SELECTED</dtml-if
  97.          >><dtml-var sequence-item html_quote></option>
  98.       </dtml-in>
  99.     </select>
  100.     <dtml-else>
  101.     No value for <dtml-var select_variable>.
  102.     </dtml-if>
  103.   <dtml-else>
  104.   <em>Unknown property type</em>
  105.   </dtml-if>
  106. </td>
  107. <td>
  108.   <select name="props.new_type:records">
  109. <dtml-in expr="('boolean', 'date', 'float', 'int', 'lines', 'long', 'string'
  110.                , 'text', 'tokens', 'selection', 'multiple selection')">
  111.   <dtml-let SELECTED="('', 'SELECTED')[new_type==_['sequence-item']]">
  112.     <option &dtml-SELECTED;>&dtml-sequence-item;</option>
  113.   </dtml-let>
  114. </dtml-in>
  115.   </select>
  116.   </dtml-let>
  117. </td>
  118. </tr>
  119. </dtml-in>
  120. <tr>
  121.   <td align="left" valign="top" width="16">
  122.   </td>
  123.   <td align="left" valign="top" colspan="2">
  124.   <input type="submit" name="manage_changePropertyTypes:method"
  125.    value="Save Changes">
  126.   <input type="submit" name="manage_propertyTypeForm:method"
  127.    value="Edit with new Types">
  128.   </td>
  129. </tr>
  130. </table>
  131.  
  132. <dtml-else>
  133. <p>
  134. No properties were selected for this item.
  135. </p>
  136.  
  137. </dtml-if>
  138. </form>
  139.  
  140. </body>
  141. </html>
  142.